package com.nanhai.buddhist.college.module.collegebase.controller.admin.professions.vo;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.property.ExcelContentProperty;

/**
 *
 */
public class ProfessionsHierarchyConverter implements Converter<String> {
	@Override
	public Class<String> supportJavaTypeKey() {
		return String.class;
	}

	@Override
	public CellDataTypeEnum supportExcelTypeKey() {
		return CellDataTypeEnum.STRING;
	}

	
	@Override
	public String convertToJavaData(@SuppressWarnings("rawtypes") CellData cellData, ExcelContentProperty contentProperty,
			GlobalConfiguration globalConfiguration) throws Exception {
		String cellDataStr = cellData.getStringValue();
		 
		return null;
	}

	/**
	 * 
	 * 方法用途: 写的时候会调用<br>
	 * 实现步骤: 0正常 1关闭<br>
	 * @param value
	 * @param contentProperty
	 * @param globalConfiguration
	 * @return
	 * @throws Exception
	 */
	@Override
	public CellData<String> convertToExcelData(String value, ExcelContentProperty contentProperty,
			GlobalConfiguration globalConfiguration) throws Exception {
        //专业层级1本科2硕士研究生3博士研究生
		if(value.equals("1")) {
			return new CellData<>("本科");
		}else if(value.equals("2")) {
			return new CellData<>("硕士研究生");
		}else if(value.equals("3")) {
			return new CellData<>("博士研究生");
		}
		return new CellData<>(value);
	}
   
}
